﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Wyn.PMS.Entity.Entities;

namespace Wyn.PMS.Common.NightAudit
{
    /// <summary>
    /// 营业日
    /// <para>--------------------------</para>
    /// <para>@Author: cnalexi@gmail.com</para> 
    /// <para>@Create: 2012/3/30</para>  
    /// </summary>
    public static class BizDay
    {
       
        public static DateTime Get(string hotelId)
        {
            var bc = BizDayCache.GetInstance();

            var bizDay = bc.GetHotelBizDay(hotelId);

            if(bizDay==null)
            {
                throw new Exception(string.Format("酒店编号{0}营业日不存在，请联系[cnalexi@gmail.com]检查服务器配置",hotelId));
            }

            return bizDay.BizDay;
        }

        
        public static HotelBizDay FullGet(string hotelId)
        {
            var cache = BizDayCache.GetInstance();

            return cache.GetHotelBizDay(hotelId);
        }

     
        public static IEnumerable<HotelBizDay> GetAll()
        {
            var cache = BizDayCache.GetInstance();

            return cache.GetHotelList();
        }
    }
}
